import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    uid:'0',  //uid用户唯一id
    userInfo:{
      nickname:'',
      headimgurl:'',
    },
    token:'', //ajax请求时的token验证，成功了才算正式用户
  },
  mutations: {
    SET_UID (state, val) {
      state.uid = val
    },
    SET_TOKEN (state, val) {
      state.token = val
    },
    SET_USERINFO (state, val) {
      state.userInfo = val
    },
  },
  actions: {},
  modules: {}
});
